home *** CD-ROM | disk | FTP | other *** search
/ PC Home 109 / PC Home 109.iso / data1.cab / Program_Files / quiz.dxr / 00027.ls < prev    next >
Encoding:
Text File  |  2001-03-02  |  1.8 KB  |  64 lines

  1. on exitFrame
  2.   global gQuestion, gCorrectSprite, gQuestionDone, gQuestionCorrect, QuestionList, CorrectAnswers, gBox1Enabled, gBox2Enabled, gBox3Enabled, gBox4Enabled
  3.   handcursor(3)
  4.   repeat with n = 9 to 12
  5.     handcursor(n)
  6.   end repeat
  7.   if gQuestion = 1 then
  8.     set gBox1Enabled to 1
  9.     set gBox2Enabled to 1
  10.     set gBox3Enabled to 1
  11.     set gBox4Enabled to 1
  12.     set QuestionList to GetRandomListOfTen(122)
  13.     set CorrectAnswers to 0
  14.     set n to getAt(QuestionList, gQuestion)
  15.     if n < 29 then
  16.       set gCorrectSprite to SetQuestionStarters(n)
  17.     else
  18.       if n < 96 then
  19.         set gCorrectSprite to SetQuestionHarder(n - 28)
  20.       else
  21.         set gCorrectSprite to SetQuestionNextlevel(n - 95)
  22.       end if
  23.     end if
  24.     set gQuestionCorrect to 1
  25.     set gQuestionDone to 0
  26.     set gQuestion to 2
  27.   end if
  28.   if gQuestionDone then
  29.     if gQuestionCorrect then
  30.       set CorrectAnswers to CorrectAnswers + 1
  31.     end if
  32.     set gBox1Enabled to 1
  33.     set gBox2Enabled to 1
  34.     set gBox3Enabled to 1
  35.     set gBox4Enabled to 1
  36.     if gQuestion = 11 then
  37.       put CorrectAnswers
  38.       addScoreToList(10, "random", CorrectAnswers, the text of field "name")
  39.       cursorOff()
  40.       go("scores4")
  41.     else
  42.       set n to getAt(QuestionList, gQuestion)
  43.       if n < 29 then
  44.         set gCorrectSprite to SetQuestionStarters(n)
  45.       else
  46.         if n < 96 then
  47.           set gCorrectSprite to SetQuestionHarder(n - 28)
  48.         else
  49.           set gCorrectSprite to SetQuestionNextlevel(n - 95)
  50.         end if
  51.       end if
  52.       set gQuestionCorrect to 1
  53.       set gQuestionDone to 0
  54.       set the memberNum of sprite 9 to 20
  55.       set the memberNum of sprite 10 to 21
  56.       set the memberNum of sprite 11 to 22
  57.       set the memberNum of sprite 12 to 23
  58.       set gQuestion to gQuestion + 1
  59.       put gQuestion
  60.     end if
  61.   end if
  62.   go(the frame)
  63. end
  64.